#!/bin/sh

LOGS=/logs/current

TAPENUM=`ls $LOGS/creating`

echo "Create unloading $TAPENUM"
/sbin/mtx unload $TAPENUM 0
mv $LOGS/creating/$TAPENUM $LOGS/done_create

NEWTAPE=$[$TAPENUM+1]
echo "Create loading $NEWTAPE"
touch $LOGS/creating/$NEWTAPE
/sbin/mtx load $NEWTAPE 0

/sbin/mtx status | grep "Data Transfer Element 0" | awk '{print $NF}' >> $LOGS/tapes.log

